const {
    Mysql
} = require('../tools/utils');
module.exports = async ctx => {
    let {
        uid
    } = ctx.query;
    if (Number(uid)) {
        console.log(uid);
        let sql = `SELECT buyVideo.orderId,video.* FROM buyVideo RIGHT JOIN video ON buyVideo.vid=video.vid WHERE buyVideo.uid=${Number(uid)}`;
        try {
            let list = await Mysql(sql);
            ctx.state.data = {
                list,
                code: '001'
            }
        } catch (error) {
            ctx.state.data = {
                code: '002'
            }
        }
    }
}